package com.seguriapp.gwt.client.mvp;

import com.google.web.bindery.event.shared.Event;

/**
 * Event for the change of a page
 */
public class PageChangedEvent extends Event<PageChangedEventHandler> {

  public static final Type<PageChangedEventHandler> TYPE = new Type<PageChangedEventHandler>();
  private final String menuId;
  
  public PageChangedEvent(final String menuId) {
    this.menuId = menuId;
  }

  @Override
  public Type<PageChangedEventHandler> getAssociatedType() {
    return TYPE;
  }
  
  public String getMenuId() {
    return menuId;
  }

  @Override
  protected void dispatch(PageChangedEventHandler handler) {
    handler.onPageChanged(this);
  }

}
